<?php
namespace app\userapi\controller;

class Order extends Base
{
    public function list()
    {
        $where = $this->request->params([
            ['trade_no', ''],
            ['status', ''],
        ]);
        $list  = $this->user->orders()->order("id desc")->withSearch($where[0], $where[1])->paginate($this->limit);
        $this->success('获取成功', [
            'list'  => $list->items(),
            'total' => $list->total(),
        ]);
    }
}
